package com.training.method;

public class MethodDemo2 {

	public static void main(String args[]) {
		System.out.println(add(1,2,3,4));
		System.out.println(add(1,2,3,4,5,6));
		
	}
	public static int add(int ...a) {
		int s = 0;
		for (int i = 0; i<a.length;i++) {
			s+=a[i];
		}
		return s ;
	}
}
